package com.itheima.edu.info.manager.day9;

public class Trees implements Comparable<Trees> {
    private int yingYu;
    private int yuWen;
    private int shuXue;

    public Trees() {
    }

    public Trees(int yingYu, int yuWen, int shuXue) {
        this.yingYu = yingYu;
        this.yuWen = yuWen;
        this.shuXue = shuXue;
    }

    public int getYingYu() {
        return yingYu;
    }

    public void setYingYu(int yingYu) {
        this.yingYu = yingYu;
    }

    public int getYuWen() {
        return yuWen;
    }

    public void setYuWen(int yuWen) {
        this.yuWen = yuWen;
    }

    public int getShuXue() {
        return shuXue;
    }

    public void setShuXue(int shuXue) {
        this.shuXue = shuXue;
    }

    @Override
    public String toString() {
        return "Trees{" +
                "yingYu=" + yingYu +
                ", yuWen=" + yuWen +
                ", shuXue=" + shuXue +
                '}';
    }


    @Override
    public int compareTo(Trees o) {
        int a = (this.getShuXue() + this.getYingYu() + this.getYuWen()) - (o.getYuWen() + o.getShuXue() + o.getYingYu());
        return a;
    }
}
